我们将玩家猜测的每种颜色添加到 guess 列表,并在游戏面板上显示颜色。
- 将用户输入变量更改为 color_guess。将每个 color_guess Append 到列表 guess。
- 添加一个名为 peg 带有坐标 x 和 y的 Circle 。圆圈的直径为 13,color_guess 为颜色。
- 让控制台 Wait 1 秒,然后使用 Add Value 在每次循环运行时向 x 加上 50 。
- 在函数内部和循环外部,使用 Return Statement 来返回变量 guess。
To navigate the page using the TAB key, first press ESC to exit the code editor.